package com.chanzany.state.case1;

/**
 * @Author ChanZany
 * @Date 2021/10/20 14:11
 * @Version 1.0
 * 具体状态类：中等
 */
public class MiddleState extends AbstractState{
    public MiddleState(AbstractState state){
        this.context = state.context;
        this.stateName = "中等";
        this.score = state.score;
    }

    @Override
    public void checkState() {
        if (score<60) context.setState(new LowState(this));
        else if (score>=90) context.setState(new HighState(this));
    }
}
